package com.xiaoshuidi.cloud.module.iot.enums;


/**
 * 琨山门锁的消息回调事件
 *
 * @author wael
 */

public enum KunShanMsgTypeEnums {
    status("49", "状态信息回调"),
    open_record("50", "开门记录回调"),
    exceptions("51", "异常回调"),
    add_password("53", "新增密码回调"),
    del_password("54", "删除密码回调"),
    update_password("55", "修改密码回调"),
    sync_password("56", "密码同步"),
    del_finger_pass("57", "删除指纹"),
    del_card("58", "删除卡片"),
    add_finger_pass("59", "上传指纹"),
    add_card("60", "上传卡片"),
    update_finger_pass_effective("61", "修改指纹有效时间"),
    update_card_effective("62", "修改指纹有效时间"),
    sync_finger_pass("63", "指纹同步"),
    sync_card("64", "卡片同步"),
    frozen_card("65", "卡片冻结"),
    frozen_finger_pass("66", "指纹冻结"),
    frozen_password("67", "密码冻结"),
    on_off_line("70", "门锁连线离线"),
    batch_on_off_line("71", "批量发送门锁连线离线"),
    power_recover("72", "门锁电量恢复回调"),
    initialization("99", "设备初始化回调"),
            ;
    private String code;
    private String desc;

    KunShanMsgTypeEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static KunShanMsgTypeEnums getInstanceByCode(String msgTypeCode) {
        for (KunShanMsgTypeEnums msgType : values()) {
            if (msgType.getCode().equals(msgTypeCode)) {
                return msgType;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
